Skip to content

build(objectql): give the package a test-layer tsc program and ledger its 242 errors - #14115

Merged
zhuangjianguo merged 2 commits into
mainfrom
claude/issue-13676-objectql-test-typecheck
Sep 1, 2026
Merged

build(objectql): give the package a test-layer tsc program and ledger its 242 errors#14115
zhuangjianguo merged 2 commits into
mainfrom
claude/issue-13676-objectql-test-typecheck

Conversation

@claude

@claude claude Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #13676

packages/objectql/tsconfig.json excluded **/*.test.ts, and the package's typecheck script was tsc --noEmit against that very config. So pnpm --filter @objectstack/objectql typecheck exiting 0 was a true sentence carrying no information about any of the package's 251 test files. This adopts the sibling-config route the repo already prescribes (the #5286 mechanism, generalised in #5449, and the route #12542 took for packages/rest).

The premise, re-verified before anything was written

Measured at 2a181174a6, workspace closure built first:

probe result
tsc --listFiles on packages/objectql (build config) 536 files in program, 0 of its 251 *.test.ts among them
same probe, objectql's own non-test src/** 50 present — so the probe fires; the zero is the exclude line
directional control: packages/drivers/driver-memory (no test exclusion) 38 of 38 test files in program

The premise held. engine-filter-array-lowering.test.ts — the negative pin required by maintainer ruling #13357 execution point 3, landed in #13673, proving a refused filter shape cannot reach the reference matcher — was in no tsc program at all.

What this changes

  • packages/objectql/tsconfig.test.json (new) — module semantics matched to vitest (esnext / bundler / lib: ES2022) and rootDir widened to the package. ⛔ Strictness is untouched: strict, noUnusedLocals, noUnusedParameters, noImplicitReturns, noFallthroughCasesInSwitch all inherit from the root config.
  • packages/objectql/package.jsontypecheck now names the sibling via check:test-typecheck, plus gen:test-typecheck-debt. tsx added to devDependencies: it was not linked into this package, and the three onboarded siblings all declare it.
  • packages/objectql/test-typecheck-debt.json (new, generated) — 44 files / 242 errors / 69 pinned signatures, exact and shrink-only.
  • scripts/check-type-check-coverage.mjs — the @objectstack/objectql TEST_DEBT entry is deleted. The package graduated, and the gate itself demands the deletion.

The number this card was dispatched to produce

242 errors across 44 files, from a raw 251 under the inherited NodeNext semantics. The config tier removed is 9: TS2550 x8 (Array.prototype.at against a lib older than es2022) and TS1470 x1 (import.meta in a CJS program).

By code: TS2339 x115 · TS7006 x36 · TS2345 x34 · TS2749 x14 · TS2322 x14 · TS6133 x9 · TS18048 x8 · TS2353 x4 · 8 singletons.

Top files: engine.test.ts x102 · datasource-mapping.test.ts x17 · plugin.integration.test.ts x12 · hook-condition-fail-loud.test.ts x12 · registry.test.ts x10 · protocol-package-lifecycle.test.ts x8.

Every one of the 242 is pre-existing: this PR edits no test file, and each would have been reported on origin/main had this program ever existed. They are ledgered per file rather than repaired, which is what #12542 did for rest's 37 and #5286 for spec's 691. Paying them down belongs on its own card, as rest's does.

Not one any and not one @ts-expect-error was added anywhere to open this gate. Bulk-suppressing the residue is the exact shape this card exists to prevent — it turns a real gate into a phantom one.

⚠️ The negative pin: zero errors, and that zero is weak

src/engine-filter-array-lowering.test.ts reports 0 errors and therefore carries no ledger entry, so any error it ever gains is red on arrival. But read the zero correctly — it is not evidence the pin is type-checked:

  • const driver: any — the recording driver, whose captured AST is the unreachability evidence.
  • interface SeenRead { ast: any } — so lastWhere(), the expression the whole proof reads, is typed by nothing.
  • 31 bare as any call sites, against the file's own header, which rejects "a bare as any" in favour of as unknown as EngineQueryOptions (asFilterArrayQuery, used 14 times).

A drifted IDataDriver signature would still not redden this file. Putting it in a program is the precondition for repairing that, not the repair; it is recorded separately and is deliberately not smuggled in here.

Verification

Run at 344681185a, workspace closure built first.

  • pnpm --filter @objectstack/objectql typecheck — exit 0. Gate's own verdict: check:test-typecheck: OK — @objectstack/objectql's test layer compiles under packages/objectql/tsconfig.test.json; 44 file(s) / 242 error(s) / 69 pinned signature(s).
  • pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2251 test files passed, 4331 tests passed.
  • pnpm check:type-check-coverage — exit 0. Test layer now reads 16 package(s) still hide their own tests / 695 files / 908 frozen errors, down from 17 / 946 / 1159.
  • pnpm check:type-check-debt — exit 0. 27 ledger entr(ies) re-measured in 195.0s, 1217 raw tsc error(s) total, none above its recorded number. surplus: none.
  • Full derived family (node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack, 34 commands): 32 exit 0, 1 already-green duplicate, 1 NOT MEASUREDcheck-test-completeness.mjs exits 3 without a CI test-run log, which its own text says to record as not measured rather than as a pass. Exit codes captured before any pipe.

Ablation — the ledger deletion is required, not cosmetic. Mutant taken byte-exact from a real commit (git checkout BASE -- scripts/check-type-check-coverage.mjs), confirmed on disk by hash (df3b0f68 to 84c4c608) and by the entry count going 0 to 1, then the gate run: exit 1, @objectstack/objectql: has a TEST_DEBT entry but has no test files -- it graduated; delete its entry from TEST_DEBT. Restore leg proven the same way and not merely trapped: on-disk hash back to df3b0f68, identical to the HEAD blob, with git diff HEAD empty.

No changeset: this publishes nothing from any package (files is dist / README.md / CHANGELOG.md, and neither new file is in it), matching PR #12570, the identical change for packages/rest, which merged under skip-changeset.

Generated by Claude Code


Generated by Claude Code

@claude claude Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 1, 2026
@github-actions github-actions Bot added the size/m label Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️ 1 changed file(s) yielded no anchor (packages/objectql/test-typecheck-debt.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/objectql/test-typecheck-debt.json) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 15 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 556ebc1509b1a6dcc842425ec58e74d095b7c966packageMentionDocs.

…VER_MANAGED

`gen:test-typecheck-debt` in `@objectstack/objectql` had no recorded merge
disposition, so `check:merge-driver` refused the branch. The artifact it writes
is a shrink-only ratchet — the same file, generator and trade as its
`packages/spec`, `packages/client` and `packages/rest` siblings — so
recomputing it mid-merge would record whatever the half-merged tree compiles to
and let a file that gained errors enter the ledger as merge noise instead of as
red. It therefore takes the NOT_DRIVER_MANAGED side, with no `.gitattributes`
route: routing a shrink-only ratchet is what that ledger exists to prevent.

Accounting in `reconcileGenerators` is keyed per (owner, script), so the entry
carries both `gen` and `owner: '@objectstack/objectql'`; the `packages/client`
and `packages/rest` copies of the same generator are accounted the same way.
@zhuangjianguo
zhuangjianguo marked this pull request as ready for review September 1, 2026 07:42
@zhuangjianguo
zhuangjianguo added this pull request to the merge queue Sep 1, 2026
Merged via the queue into main with commit 9235e2d Sep 1, 2026
35 checks passed
@zhuangjianguo
zhuangjianguo deleted the claude/issue-13676-objectql-test-typecheck branch September 1, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants